package com.mudongheng.app;

import com.mudongheng.app.mapper.SysUserMapper;
import com.mudongheng.app.model.SysUser;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);
        SysUserMapper sysUserMapper = run.getBean("sysUserMapper", SysUserMapper.class);
        for (int i = 0; i < 10; i++) {
            SysUser sysUser = new SysUser(i, "name" + i);
            sysUserMapper.insert(sysUser);
        }
        System.out.println(sysUserMapper.selectList(null));
        sysUserMapper.updateById(new SysUser(5, "zzdd"));
        System.out.println(sysUserMapper.selectList(null));
        sysUserMapper.deleteById(3);
        System.out.println(sysUserMapper.selectList(null));

    }

}